﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Xml.Serialization;
using System.Windows.Forms;
using Editor.Utilities;

namespace Editor.PageControls
{
    public class PageHideButton : PageControl<string>
    {
        public PageHideButton()
        {
            Dictionary = new SDictionary<string>();
        }

        public string HideControl { get; set; }

        public override string NamingPrefix
        {
            get { return "düğme"; }
        }

        public override void UpdateInnerControl()
        {
            Button hideButton = InnerControl as Button;

            hideButton.Font = new Font("Segoe UI", TextFontSize, FontStyle.Regular, GraphicsUnit.Point);
            hideButton.Location = Location;
            hideButton.BackColor = BackColor;
            hideButton.ForeColor = ForeColor;
            hideButton.Text = CurrentElement;
            hideButton.Visible = Visible;
            hideButton.Size = hideButton.CreateGraphics().MeasureString(hideButton.Text, hideButton.Font).ToSize();
            Size = hideButton.Size;
        }

        protected override PropertiesFormBase generatePropertiesForm()
        {
            return new ButtonHideProperties();
        }

        protected override Control generateInnerControl()
        {
            Button hideButton = new Button();
            
            hideButton.AutoSize = true;

            return hideButton;
        } 

        public override object Clone()
        {
            PageHideButton newPageLabel = new PageHideButton();

            newPageLabel.BackColor = BackColor;
            newPageLabel.ForeColor = ForeColor;
            newPageLabel.Location = Location;
            newPageLabel.HideControl = HideControl;
            newPageLabel.Name = Name;
            newPageLabel.TextFontSize = TextFontSize;
            newPageLabel.Visible = Visible;
            newPageLabel.Dictionary = Dictionary.Clone() as SDictionary<string>;

            return newPageLabel;
        }
    }
}
